package xyz.showbooks.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import xyz.dfm.pojo.Vip;
import xyz.showbooks.service.VipService;



@CrossOrigin
@RestController
@RequestMapping("/vip")
public class VipController {

    @Autowired
    private VipService vipService;

    //修改的回显
    @GetMapping("/findId/{userId}")
    public Vip findId(@PathVariable Integer userId){
        return vipService.findId(userId);
    }

    //根据用户ID查询vip信息
    @GetMapping("/findVipByUserId/{userId}")
    public Vip findVipByUserId(String id){
        return vipService.findVipByUserId(id);
    }

    //修改用户会员信息
    @PutMapping("/updateVip")
    public void updateVipStatus(@RequestBody Vip vip){
        vipService.updateVipStatus(vip);
    }

}
